<?php

namespace App\Models\System;

use App\Traits\Relation\ModuleRelation;
use Illuminate\Database\Eloquent\Model;

/**
 * 系统模块数据模型
 *
 * Date: 20/03/2018
 * @author George
 * @package App\Models\System
 */
class Module extends Model
{
	use ModuleRelation;

	/**
	 * 定义主键
	 *
	 * @var string
	 * Date: 22/03/2018
	 * @author George
	 */
	protected $primaryKey = 'code';

	/**
	 * 禁用自增
	 *
	 * @var bool
	 * Date: 17/04/2018
	 * @author George
	 */
	public $incrementing = false;

	/**
	 * 定义隐藏的字段
	 *
	 * @var array
	 * Date: 21/03/2018
	 * @author George
	 */
	protected $hidden = [
		'created_at', 'updated_at'
	];

	/**
	 * 定义数据类型
	 *
	 * @var array
	 * Date: 23/03/2018
	 * @author George
	 */
	protected $casts = [
		'code' => 'string'
	];
}
